## Understanding Public Attitudes toward Restrictive Voting Laws
## Katie Clayton  
## Step 4: Additional analyses and robustness checks
## Last updated: June 8, 2023

# Initial settings --------------------------------------------------------

rm(list = ls())
library(tidyverse)


# Robustness checks -------------------------------------------------------

df <- read.csv("output/cleaned_dataset.csv") %>%
  mutate(group = factor(group, levels = c("control","harm","boost"))) 


# Credibility of information -----------------------------------------------

summary(df$credible)
table(df$credible)


# Manipulation check ------------------------------------------------------

summary(df$mc_vr)
table(df$mc_vr, df$group)

harm <- df %>% filter(group == "harm")
boost <- df %>% filter(group == "boost")
control <- df %>% filter(group == "control")

t.test(harm$mc_vr, boost$mc_vr)
t.test(control$mc_vr, boost$mc_vr)
t.test(control$mc_vr, harm$mc_vr)



